home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_COLORCH.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
3KB
|
93 lines
FUNCTION _ColorChk
PARAMETERS pc_WhichCo
*---------------------------------------------------------------------
* NAME
* _ColorChk - Return a specific color attribute setting.
*
* SYNOPSIS
* _ColorChk( pc_WhichCo )
*
* DESCRIPTION
* _ColorChk() returns a string representing one of eight
* possible color attribute values. The first letters of
* the argument string mean the following. (These are listed
* in the same order as they are returned by SET("ATTRIBUTES".
* Upper or lower case may be used.)
*
* "N" - Normal.
* "H" - Highlight.
* "P" - Perimeter.
* "M" - Messages.
* "T" - Titles.
* "B" - Box.
* "I" - Information.
* "F" - Fields.
*
* The string returned is of the pattern: <foreground/background>.
* Letters are used to represent specific colors. For example,
* the string "W+/B" indicates bright white on blue. The dBASE IV
* documentation includes detailed explanation of these codes.
*
* NOTE
* Since only the first letter of the argument is used, the
* full words can be used for greater code readability. Thus,
* the following three sample lines of code are identical:
*
* lc_fldclr = _ColorChk( "f" )
* lc_fldclr = _ColorChk( "FIELDS" )
* lc_fldclr = _ColorChk( "Fuzzy wuzzy" )
*
* PARAMETERS
* pc_WhichCo = The single letter or string indicating which color
* attribute string to return.
*
* LIMITATIONS
* _ColorChk() does not test for valid arguments.
* An argument starting with a letter other than the eight
* listed above will return the Normal color setting string.
*
* SEE ALSO:
* SET("ATTRIBUTES"), SET COLOR
*
*---------------------------------------------------------------------
PRIVATE lc_colattr, lc_whichco, ln_count, ln_stop_at, lc_attrib
lc_whichco = UPPER(LEFT(pc_whichco,1))
lc_attrib = SET("ATTRIBUTE")
IF lc_whichco $ "MTBIF"
lc_colattr = SUBSTR(lc_attrib, AT("&", lc_attrib) + 2)
ELSE
lc_colattr = LEFT(lc_attrib, AT("&", lc_attrib) - 2)
ENDIF
DO CASE
CASE lc_whichco = "F"
ln_stop_at = 4
CASE lc_whichco = "I"
ln_stop_at = 3
CASE lc_whichco $ "BP"
ln_stop_at = 2
CASE lc_whichco $ "TH"
ln_stop_at = 1
OTHERWISE
ln_stop_at = 0
ENDCASE
ln_count = 1
DO WHILE m->ln_count <= m->ln_stop_at
lc_colattr = SUBSTR(m->lc_colattr, AT(",", m->lc_colattr) + 1)
ln_count = m->ln_count + 1
ENDDO
RETURN IIF("," $ lc_colattr, ;
LEFT(lc_colattr, AT(",", lc_colattr) - 1), ;
lc_colattr ;
)
*-- EOF: _ColorChk( pc_WhichCo )